/*
 * @Author: jswang
 * @Date: 2021-07-25 23:05:15
 * @LastEditTime: 2021-07-26 16:05:28
 */
/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
    return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
    const valid_map = ['admin', 'editor']
    return valid_map.indexOf(str.trim()) >= 0
}

// 校验手机号码
export function validMobile(str) {
    return /^1[3-9]\d{9}$/.test(str)
}